#ifndef _INPUT_H_
#define _INPUT_H_

#include <common.h>

////////////////////////////////////////////////////////////////////////////////

enum EventType
{
  EVENT_QUIT,
  EVENT_MOUSE_PRESS,
  EVENT_MOUSE_RELEASE,
  EVENT_KEY_DOWN,
};

enum MouseButton
{
  MOUSE_BUTTON_LEFT,
  MOUSE_BUTTON_RIGHT,
};

struct MousePressEvent
{
  MouseButton button;
  Point pos;
};

enum Key
{
  KEY_NONE,
  KEY_BACKSPACE,
  KEY_TAB,
  KEY_RETURN,
  KEY_PAUSE,
  KEY_ESCAPE,
  KEY_SPACE,
  KEY_EXCLAIM,
  KEY_DBLQUOTE,
  KEY_HASH,
  KEY_DOLLAR,
  KEY_AMPERSAND,
  KEY_QUOTE,
  KEY_LEFTPAREN,
  KEY_RIGHTPAREN,
  KEY_ASTERISK,
  KEY_PLUS,
  KEY_COMMA,
  KEY_MINUS,
  KEY_PERIOD,
  KEY_SLASH,
  KEY_0,
  KEY_1,
  KEY_2,
  KEY_3,
  KEY_4,
  KEY_5,
  KEY_6,
  KEY_7,
  KEY_8,
  KEY_9,
  KEY_COLON,
  KEY_SEMICOLON,
  KEY_LESS,
  KEY_EQUALS,
  KEY_GREATER,
  KEY_QUESTION,
  KEY_AT,
  KEY_LEFTBRACKET,
  KEY_BACKSLASH,
  KEY_RIGHTBRACKET,
  KEY_CARET,
  KEY_UNDERSCORE,
  KEY_BACKQUOTE,
  KEY_A,
  KEY_B,
  KEY_C,
  KEY_D,
  KEY_E,
  KEY_F,
  KEY_G,
  KEY_H,
  KEY_I,
  KEY_J,
  KEY_K,
  KEY_L,
  KEY_M,
  KEY_N,
  KEY_O,
  KEY_P,
  KEY_Q,
  KEY_R,
  KEY_S,
  KEY_T,
  KEY_U,
  KEY_V,
  KEY_W,
  KEY_X,
  KEY_Y,
  KEY_Z,
  KEY_DELETE,
};

struct KeyPressEvent
{
  Key key;
  char c;
};

struct Event
{
  EventType type;
  MousePressEvent mouse_press;
  KeyPressEvent key_press;
};

////////////////////////////////////////////////////////////////////////////////

void Input_init();

bool Input_pollEvent(Event* event);

#endif
